{
    class Person{
        protected name: string
        public age: number
        private site:string
        private show():string {
            return `${this.name}的年龄是${this.age}来自于${this.site}`;
        }
        protected Info():string {
            return this.show();
        }
        protected showAge():number {
            return this.age;
        }
    }
    class User extends Person{
        constructor(a:string,b:number){
            super();
            this.name = a;
            this.age = b;
        }
        // 父类为private类型，子类不可以重写
        // private show():string {
        //     return `${this.name}的年龄是${this.age}`;
        // }
    
        // 父类为protected类型，子类不可以改写成private类型，只能向宽泛兼容，可以改写成public类型
        // private showAge():number {
        //     return this.age;
        // }
        public get():string {
            return this.Info();
        }
    }
    
    // site是private类型，不能在其子类和外部访问
    // hd.site = "hdms";
    // console.log(hd.site);
    
    const hd = new User('后盾人',18);
    console.log(hd.get());
}